﻿namespace Text2Rss.Database.Migrations
{
	using System.Data;
	using ECM7.Migrator.Framework;

	[Migration(4)]
	public class Migration004_Post : Migration
	{
		public override void Apply()
		{
			Database.AddTable(
				"Post",
				new Column("Id", DbType.Guid, ColumnProperty.PrimaryKey),
				new Column("Version", DbType.Int32, ColumnProperty.NotNull),
				new Column("FeedId", DbType.Guid, ColumnProperty.NotNull),
				new Column("Content", DbType.String, ColumnProperty.NotNull),
				new Column("DateTime", DbType.DateTime, ColumnProperty.NotNull));

			Database.AddForeignKey("FK_Post_Feed", "Post", "FeedId", "Feed", "Id");
		}

		public override void Revert()
		{
			Database.RemoveTable("Post");
		}
	}
}